<?php
Zend_Loader::loadClass("BaseControllerAction");
Zend_Loader::loadClass("Output_ReportMeterData");

class PlotterController extends BaseControllerAction
{
	private $_params = array();
	
	public function init()
	{
		parent::init();
		$this->_helper->layout->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
	}

	public function plotterAction() {
		echo "Plotter Action";
		$db = new Zend_Db_Adapter_Pdo_Sqlite(array(
			'dbname'   => APPLICATION_PATH . "/resources/output.sqlite"
		));
		
		$sql = 'SELECT * FROM ReportMeterData WHERE rowid = ?';
		
		$result = $db->fetchAll($sql, 2);
		//Zend_Debug::dump($result);
		//$t = new MyTable();
		//Zend_Debug::dump ($t->getDefaultAdapter());
		//Zend_Debug::dump (Zend_Registry::get('dbAdapters'));
		
		$report = new Output_ReportMeterData();
		$recordSet = $report->find(25);
		$result = $recordSet->current();
		$result = $result->toArray();
		
		Zend_Debug::dump($result);
		
		
    }

    public function __call($arg1, $arg2) {
        echo "Bad arguments";
    }
}

    

class MyTable extends Zend_Db_Table_Abstract {
}
